home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 3762 < prev    next >
Mailbox/MIME Entity  |  1996-08-06  |  3.8 KB

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: Mailbox/MIME Entity (archive/mbox).

ConfidenceProgramDetectionMatch TypeSupport
100% dexvert Mailbox/MIME Entity (archive/mbox) magic Supported
1% dexvert Text File (text/txt) fallback Supported
100% file C++ source text default
99% file C source text default
98% file C source, ASCII text default
100% checkBytes Printable ASCII default
100% perlTextCheck Likely Text (Perl) default
100% siegfried fmt/950 MIME Email (1.0) default
100% detectItEasy Format: plain text[LF] default (weak)



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 4e 65 77 73 67 72 6f 75 | 70 73 3a 20 63 6f 6d 70 |Newsgrou|ps: comp|
|00000010| 2e 6c 61 6e 67 2e 63 2b | 2b 0a 50 61 74 68 3a 20 |.lang.c+|+.Path: |
|00000020| 69 6e 31 2e 75 75 2e 6e | 65 74 21 62 63 73 74 65 |in1.uu.n|et!bcste|
|00000030| 63 21 6e 6e 74 70 0a 46 | 72 6f 6d 3a 20 4b 65 76 |c!nntp.F|rom: Kev|
|00000040| 69 6e 20 49 6e 67 61 6c | 6c 73 20 3c 69 6e 67 6b |in Ingal|ls <ingk|
|00000050| 6c 39 30 30 40 63 63 6d | 61 69 6c 2e 63 61 2e 62 |l900@ccm|ail.ca.b|
|00000060| 6f 65 69 6e 67 2e 63 6f | 6d 3e 0a 53 75 62 6a 65 |oeing.co|m>.Subje|
|00000070| 63 74 3a 20 52 65 3a 20 | 50 6f 69 6e 74 65 72 73 |ct: Re: |Pointers|
|00000080| 20 48 45 4c 50 21 21 21 | 21 0a 58 2d 4e 6e 74 70 | HELP!!!|!.X-Nntp|
|00000090| 2d 50 6f 73 74 69 6e 67 | 2d 48 6f 73 74 3a 20 31 |-Posting|-Host: 1|
|000000a0| 33 37 2e 31 33 36 2e 31 | 36 2e 31 34 39 0a 43 6f |37.136.1|6.149.Co|
|000000b0| 6e 74 65 6e 74 2d 54 79 | 70 65 3a 20 74 65 78 74 |ntent-Ty|pe: text|
|000000c0| 2f 70 6c 61 69 6e 3b 20 | 63 68 61 72 73 65 74 3d |/plain; |charset=|
|000000d0| 75 73 2d 61 73 63 69 69 | 0a 4d 65 73 73 61 67 65 |us-ascii|.Message|
|000000e0| 2d 49 44 3a 20 3c 44 4c | 72 45 49 75 2e 38 31 48 |-ID: <DL|rEIu.81H|
|000000f0| 40 62 63 73 74 65 63 2e | 63 61 2e 62 6f 65 69 6e |@bcstec.|ca.boein|
|00000100| 67 2e 63 6f 6d 3e 0a 54 | 6f 3a 20 64 65 6c 65 6e |g.com>.T|o: delen|
|00000110| 6e 40 62 61 62 63 6f 6d | 2e 73 70 61 63 65 2e 63 |n@babcom|.space.c|
|00000120| 6f 6d 0a 53 65 6e 64 65 | 72 3a 20 6e 6e 74 70 40 |om.Sende|r: nntp@|
|00000130| 62 63 73 74 65 63 2e 63 | 61 2e 62 6f 65 69 6e 67 |bcstec.c|a.boeing|
|00000140| 2e 63 6f 6d 20 28 4e 4e | 54 50 20 4e 65 77 73 20 |.com (NN|TP News |
|00000150| 41 63 63 65 73 73 29 0a | 43 6f 6e 74 65 6e 74 2d |Access).|Content-|
|00000160| 54 72 61 6e 73 66 65 72 | 2d 45 6e 63 6f 64 69 6e |Transfer|-Encodin|
|00000170| 67 3a 20 37 62 69 74 0a | 4f 72 67 61 6e 69 7a 61 |g: 7bit.|Organiza|
|00000180| 74 69 6f 6e 3a 20 42 6f | 65 69 6e 67 20 44 65 66 |tion: Bo|eing Def|
|00000190| 65 6e 73 65 20 26 20 53 | 70 61 63 65 20 47 72 6f |ense & S|pace Gro|
|000001a0| 75 70 20 54 72 61 69 6e | 69 6e 67 0a 52 65 66 65 |up Train|ing.Refe|
|000001b0| 72 65 6e 63 65 73 3a 20 | 3c 33 31 30 35 35 65 31 |rences: |<31055e1|
|000001c0| 64 2e 31 30 32 30 31 39 | 33 40 6e 65 77 73 2e 70 |d.102019|3@news.p|
|000001d0| 69 2e 73 65 3e 0a 4d 69 | 6d 65 2d 56 65 72 73 69 |i.se>.Mi|me-Versi|
|000001e0| 6f 6e 3a 20 31 2e 30 0a | 44 61 74 65 3a 20 54 68 |on: 1.0.|Date: Th|
|000001f0| 75 2c 20 32 35 20 4a 61 | 6e 20 31 39 39 36 20 32 |u, 25 Ja|n 1996 2|
|00000200| 32 3a 35 39 3a 31 38 20 | 47 4d 54 0a 58 2d 4d 61 |2:59:18 |GMT.X-Ma|
|00000210| 69 6c 65 72 3a 20 4d 6f | 7a 69 6c 6c 61 20 31 2e |iler: Mo|zilla 1.|
|00000220| 31 4e 20 28 4d 61 63 69 | 6e 74 6f 73 68 3b 20 49 |1N (Maci|ntosh; I|
|00000230| 3b 20 50 50 43 29 0a 58 | 2d 55 72 6c 3a 20 6e 65 |; PPC).X|-Url: ne|
|00000240| 77 73 3a 33 31 30 35 35 | 65 31 64 2e 31 30 32 30 |ws:31055|e1d.1020|
|00000250| 31 39 33 40 6e 65 77 73 | 2e 70 69 2e 73 65 0a 0a |193@news|.pi.se..|
|00000260| 64 65 6c 65 6e 6e 40 62 | 61 62 63 6f 6d 2e 73 70 |delenn@b|abcom.sp|
|00000270| 61 63 65 2e 63 6f 6d 20 | 28 53 61 74 61 69 20 44 |ace.com |(Satai D|
|00000280| 65 6c 65 6e 6e 29 20 77 | 72 6f 74 65 3a 0a 3e 48 |elenn) w|rote:.>H|
|00000290| 69 61 21 0a 3e 0a 3e 57 | 68 61 74 20 49 20 77 61 |ia!.>.>W|hat I wa|
|000002a0| 6e 74 20 74 6f 20 64 6f | 20 69 73 20 74 6f 20 70 |nt to do| is to p|
|000002b0| 61 73 73 20 61 20 70 6f | 69 6e 74 65 72 20 74 6f |ass a po|inter to|
|000002c0| 20 61 20 6d 65 6d 62 65 | 72 20 66 75 6e 63 74 69 | a membe|r functi|
|000002d0| 6f 6e 20 74 6f 20 61 6e | 6f 74 68 65 72 0a 3e 6f |on to an|other.>o|
|000002e0| 62 6a 65 63 74 2c 20 77 | 68 69 63 68 20 6c 61 74 |bject, w|hich lat|
|000002f0| 65 72 20 77 69 6c 6c 20 | 63 61 6c 6c 20 74 68 69 |er will |call thi|
|00000300| 73 20 66 75 6e 63 74 69 | 6f 6e 20 74 68 72 75 20 |s functi|on thru |
|00000310| 74 68 69 73 20 70 6f 69 | 6e 74 65 72 2e 0a 3e 0a |this poi|nter..>.|
|00000320| 3e 57 68 61 74 20 49 20 | 64 69 64 3a 0a 3e 0a 3e |>What I |did:.>.>|
|00000330| 2f 2f 2f 2f 2f 2f 2f 2f | 2f 2f 2f 2f 2f 2f 2f 2f |////////|////////|
|00000340| 2f 2f 2f 2f 2f 2f 2f 2f | 2f 2f 2f 2f 2f 2f 2f 2f |////////|////////|
|00000350| 2f 2f 2f 2f 2f 2f 2f 2f | 2f 2f 2f 2f 2f 2f 2f 2f |////////|////////|
|00000360| 2f 2f 2f 2f 0a 3e 74 79 | 70 65 64 65 66 20 76 6f |////.>ty|pedef vo|
|00000370| 69 64 28 2a 50 46 55 4e | 43 29 28 69 6e 74 29 3b |id(*PFUN|C)(int);|
|00000380| 0a 3e 2f 2f 2f 2f 2f 2f | 2f 2f 2f 2f 2f 2f 2f 2f |.>//////|////////|
|00000390| 2f 2f 2f 2f 2f 2f 2f 2f | 2f 2f 2f 2f 2f 2f 2f 2f |////////|////////|
|000003a0| 2f 2f 2f 2f 2f 2f 2f 2f | 2f 2f 2f 2f 2f 2f 2f 2f |////////|////////|
|000003b0| 2f 2f 2f 2f 2f 2f 0a 3e | 0a 3e 63 6c 61 73 73 20 |//////.>|.>class |
|000003c0| 41 0a 3e 7b 0a 3e 70 75 | 62 6c 69 63 3a 0a 3e 09 |A.>{.>pu|blic:.>.|
|000003d0| 76 6f 69 64 20 63 61 6c | 6c 62 61 63 6b 28 69 6e |void cal|lback(in|
|000003e0| 74 20 65 72 72 6f 72 29 | 20 7b 0a 3e 09 09 2f 2a |t error)| {.>../*|
|000003f0| 20 53 6f 6d 65 74 68 69 | 6e 67 20 2a 2f 3b 0a 3e | Somethi|ng */;.>|
|00000400| 09 7d 0a 3e 0a 3e 09 42 | 2a 20 70 42 3b 0a 3e 70 |.}.>.>.B|* pB;.>p|
|00000410| 75 62 6c 69 63 3a 0a 3e | 09 41 28 29 20 7b 0a 3e |ublic:.>|.A() {.>|
|00000420| 09 09 70 42 20 3d 20 6e | 65 77 20 42 28 41 3a 3a |..pB = n|ew B(A::|
|00000430| 63 61 6c 6c 62 61 63 6b | 29 3b 0a 3e 09 7d 3b 0a |callback|);.>.};.|
|00000440| 3e 09 7e 41 28 29 20 7b | 0a 3e 09 09 64 65 6c 65 |>.~A() {|.>..dele|
|00000450| 74 65 20 70 42 3b 0a 3e | 09 7d 3b 0a 3e 7d 3b 0a |te pB;.>|.};.>};.|
|00000460| 0a 41 73 20 79 6f 75 20 | 68 61 76 65 20 77 72 69 |.As you |have wri|
|00000470| 74 74 65 6e 20 69 74 2c | 20 50 46 55 4e 43 20 69 |tten it,| PFUNC i|
|00000480| 73 20 6e 6f 74 20 6f 66 | 20 74 68 65 20 73 61 6d |s not of| the sam|
|00000490| 65 20 74 79 70 65 20 61 | 73 0a 61 20 70 6f 69 6e |e type a|s.a poin|
|000004a0| 74 65 72 20 74 6f 20 74 | 68 65 20 6d 65 6d 62 65 |ter to t|he membe|
|000004b0| 72 20 66 75 6e 63 74 69 | 6f 6e 20 41 3a 3a 63 61 |r functi|on A::ca|
|000004c0| 6c 6c 62 61 63 6b 2e 20 | 54 68 65 20 74 79 70 65 |llback. |The type|
|000004d0| 20 6f 66 20 61 0a 70 6f | 69 6e 74 65 72 20 74 6f | of a.po|inter to|
|000004e0| 20 61 20 6d 65 6d 62 65 | 72 20 66 75 6e 63 74 69 | a membe|r functi|
|000004f0| 6f 6e 20 6f 66 20 2a 69 | 6e 20 74 68 65 20 73 63 |on of *i|n the sc|
|00000500| 6f 70 65 20 6f 66 20 41 | 2a 20 74 68 61 74 20 72 |ope of A|* that r|
|00000510| 65 74 75 72 6e 73 0a 6e | 6f 74 68 69 6e 67 20 28 |eturns.n|othing (|
|00000520| 69 2e 65 2e 2c 20 76 6f | 69 64 29 20 61 6e 64 20 |i.e., vo|id) and |
|00000530| 74 61 6b 65 73 20 61 6e | 20 69 6e 74 20 61 73 20 |takes an| int as |
|00000540| 61 20 70 61 72 61 6d 65 | 74 65 72 20 69 73 0a 76 |a parame|ter is.v|
|00000550| 6f 69 64 20 28 41 3a 3a | 2a 29 20 28 69 6e 74 29 |oid (A::|*) (int)|
|00000560| 2e 20 54 68 65 72 65 66 | 6f 72 65 2c 20 74 68 65 |. Theref|ore, the|
|00000570| 20 74 79 70 65 64 65 66 | 20 73 68 6f 75 6c 64 20 | typedef| should |
|00000580| 6c 6f 6f 6b 20 6c 69 6b | 65 3a 0a 0a 74 79 70 65 |look lik|e:..type|
|00000590| 64 65 66 20 76 6f 69 64 | 20 28 41 3a 3a 2a 20 50 |def void| (A::* P|
|000005a0| 46 55 4e 43 29 28 69 6e | 74 29 3b 0a 0a 48 6f 77 |FUNC)(in|t);..How|
|000005b0| 65 76 65 72 2c 20 74 68 | 65 72 65 20 69 73 20 61 |ever, th|ere is a|
|000005c0| 6e 6f 74 68 65 72 20 70 | 72 6f 62 6c 65 6d 2e 2e |nother p|roblem..|
|000005d0| 2e 0a 0a 0a 3e 2f 2f 2f | 2f 2f 2f 2f 2f 2f 2f 2f |....>///|////////|
|000005e0| 2f 2f 2f 2f 2f 2f 2f 2f | 2f 2f 2f 2f 2f 2f 2f 2f |////////|////////|
|000005f0| 2f 2f 2f 2f 2f 2f 2f 2f | 2f 2f 2f 2f 2f 2f 2f 2f |////////|////////|
|00000600| 2f 2f 2f 2f 2f 2f 2f 2f | 2f 0a 3e 63 6c 61 73 73 |////////|/.>class|
|00000610| 20 42 0a 3e 7b 0a 3e 70 | 75 62 6c 69 63 3a 0a 3e | B.>{.>p|ublic:.>|
|00000620| 09 50 46 55 4e 43 20 6d | 5f 63 61 6c 6c 62 61 63 |.PFUNC m|_callbac|
|00000630| 6b 3b 0a 3e 70 75 62 6c | 69 63 3a 0a 3e 09 42 28 |k;.>publ|ic:.>.B(|
|00000640| 50 46 55 4e 43 20 63 61 | 6c 6c 62 61 63 6b 29 20 |PFUNC ca|llback) |
|00000650| 7b 0a 3e 09 09 6d 5f 63 | 61 6c 6c 62 61 63 6b 20 |{.>..m_c|allback |
|00000660| 3d 20 63 61 6c 6c 62 61 | 63 6b 3b 09 09 0a 3e 09 |= callba|ck;...>.|
|00000670| 09 2a 6d 5f 63 61 6c 6c | 62 61 63 6b 28 31 30 29 |.*m_call|back(10)|
|00000680| 3b 0a 3e 09 7d 09 0a 3e | 09 7e 42 28 29 7b 7d 3b |;.>.}..>|.~B(){};|
|00000690| 0a 3e 7d 3b 0a 3e 2f 2f | 2f 2f 2f 2f 2f 2f 2f 2f |.>};.>//|////////|
|000006a0| 2f 2f 2f 2f 2f 2f 2f 2f | 2f 2f 2f 2f 2f 2f 2f 2f |////////|////////|
|000006b0| 2f 2f 2f 2f 2f 2f 2f 2f | 2f 2f 2f 2f 2f 2f 2f 2f |////////|////////|
|000006c0| 2f 2f 2f 2f 2f 2f 2f 2f | 2f 2f 0a 3e 0a 0a 49 6e |////////|//.>..In|
|000006d0| 20 74 68 65 20 63 6f 6e | 73 74 72 75 63 74 6f 72 | the con|structor|
|000006e0| 20 6f 66 20 42 2c 20 74 | 68 65 72 65 20 69 73 20 | of B, t|here is |
|000006f0| 6e 6f 20 6f 62 6a 65 63 | 74 20 6f 66 20 63 6c 61 |no objec|t of cla|
|00000700| 73 73 20 41 2c 20 61 6e | 64 20 74 68 65 72 65 66 |ss A, an|d theref|
|00000710| 6f 72 65 0a 6e 6f 20 22 | 74 68 69 73 22 20 70 6f |ore.no "|this" po|
|00000720| 69 6e 74 65 72 2c 20 61 | 6e 64 20 74 68 65 20 63 |inter, a|nd the c|
|00000730| 61 6c 6c 20 74 6f 20 74 | 68 65 20 66 75 6e 63 74 |all to t|he funct|
|00000740| 69 6f 6e 20 77 6f 6e 27 | 74 20 77 6f 72 6b 2e 20 |ion won'|t work. |
|00000750| 4f 6e 65 20 77 61 79 20 | 74 6f 20 0a 73 6f 6c 76 |One way |to .solv|
|00000760| 65 20 74 68 69 73 20 70 | 72 6f 62 6c 65 6d 20 69 |e this p|roblem i|
|00000770| 73 20 74 6f 20 6d 61 6b | 65 20 74 68 65 20 6d 65 |s to mak|e the me|
|00000780| 6d 62 65 72 20 66 75 6e | 63 74 69 6f 6e 20 73 74 |mber fun|ction st|
|00000790| 61 74 69 63 2c 20 77 68 | 69 63 68 20 6d 65 61 6e |atic, wh|ich mean|
|000007a0| 73 0a 74 68 61 74 20 74 | 68 65 20 74 79 70 65 64 |s.that t|he typed|
|000007b0| 65 66 20 6e 65 65 64 73 | 20 74 6f 20 63 68 61 6e |ef needs| to chan|
|000007c0| 67 65 20 62 61 63 6b 20 | 74 6f 20 77 68 61 74 20 |ge back |to what |
|000007d0| 79 6f 75 20 68 61 64 20 | 6f 72 69 67 69 6e 61 6c |you had |original|
|000007e0| 6c 79 2e 0a 0a 42 54 57 | 2c 20 6e 6f 20 69 6e 64 |ly...BTW|, no ind|
|000007f0| 69 72 65 63 74 69 6f 6e | 20 69 73 20 6e 65 63 65 |irection| is nece|
|00000800| 73 73 61 72 79 20 77 68 | 65 6e 20 63 61 6c 6c 69 |ssary wh|en calli|
|00000810| 6e 67 20 61 0a 66 75 6e | 63 74 69 6f 6e 20 75 73 |ng a.fun|ction us|
|00000820| 69 6e 67 20 61 20 66 75 | 6e 63 74 69 6f 6e 20 70 |ing a fu|nction p|
|00000830| 6f 69 6e 74 65 72 20 28 | 77 68 65 74 68 65 72 20 |ointer (|whether |
|00000840| 6d 65 6d 62 65 72 20 6f | 72 20 6e 6f 6e 2d 6d 65 |member o|r non-me|
|00000850| 6d 62 65 72 29 2c 20 62 | 75 74 0a 69 6e 20 61 6e |mber), b|ut.in an|
|00000860| 79 20 63 61 73 65 20 74 | 68 65 20 73 79 6e 74 61 |y case t|he synta|
|00000870| 78 20 66 6f 72 20 66 75 | 6e 63 74 69 6f 6e 20 70 |x for fu|nction p|
|00000880| 6f 69 6e 74 65 72 20 69 | 6e 64 69 72 65 63 74 69 |ointer i|ndirecti|
|00000890| 6f 6e 20 69 73 3a 0a 09 | 09 0a 09 09 28 2a 6d 5f |on is:..|....(*m_|
|000008a0| 63 61 6c 6c 62 61 63 6b | 29 28 31 30 29 3b 0a 0a |callback|)(10);..|
|000008b0| 6e 6f 74 20 0a 0a 09 09 | 2a 6d 5f 63 61 6c 6c 62 |not ....|*m_callb|
|000008c0| 61 63 6b 28 31 30 29 3b | 20 2f 2f 20 74 68 69 73 |ack(10);| // this|
|000008d0| 20 73 61 79 73 20 22 70 | 65 72 66 6f 72 6d 20 69 | says "p|erform i|
|000008e0| 6e 64 69 72 65 63 74 69 | 6f 6e 0a 20 20 20 20 20 |ndirecti|on. |
|000008f0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 2f 2f | | //|
|00000900| 20 6f 6e 20 74 68 65 20 | 72 65 74 75 72 6e 20 76 | on the |return v|
|00000910| 61 6c 75 65 20 6f 66 20 | 74 68 65 20 63 61 6c 6c |alue of |the call|
|00000920| 65 64 20 66 75 6e 63 74 | 69 6f 6e 0a 09 09 09 09 |ed funct|ion.....|
|00000930| 09 09 09 0a 0a 3e 49 20 | 6b 6e 6f 77 20 74 68 69 |.....>I |know thi|
|00000940| 73 20 64 6f 65 73 6e 74 | 20 77 6f 72 6b 2c 20 73 |s doesnt| work, s|
|00000950| 6f 20 70 6c 65 61 73 65 | 20 6e 65 31 20 68 65 6c |o please| ne1 hel|
|00000960| 70 20 6d 65 20 6f 75 74 | 20 68 65 72 65 2e 0a 3e |p me out| here..>|
|00000970| 0a 3e 2f 2f 20 74 68 6f | 6d 61 73 40 6d 65 64 69 |.>// tho|mas@medi|
|00000980| 61 6d 61 74 69 63 2e 73 | 65 0a 3e 0a 3e 0a 3e 0a |amatic.s|e.>.>.>.|
|00000990| 0a 49 20 6b 6e 6f 77 20 | 74 68 69 73 20 65 78 70 |.I know |this exp|
|000009a0| 6c 61 69 6e 61 74 69 6f | 6e 20 69 73 20 61 20 6c |lainatio|n is a l|
|000009b0| 69 74 74 6c 65 20 6f 62 | 73 63 75 72 65 2c 20 62 |ittle ob|scure, b|
|000009c0| 75 74 20 74 68 65 72 65 | 20 61 20 6e 75 6d 62 65 |ut there| a numbe|
|000009d0| 72 0a 6f 66 20 69 74 65 | 6d 73 20 66 6c 6f 61 74 |r.of ite|ms float|
|000009e0| 69 6e 67 20 61 72 6f 75 | 6e 64 20 68 65 72 65 2e |ing arou|nd here.|
|000009f0| 20 49 6e 20 61 20 6e 75 | 74 73 68 65 6c 6c 2c 20 | In a nu|tshell, |
|00000a00| 70 6f 69 6e 74 65 72 73 | 20 74 6f 20 66 75 6e 63 |pointers| to func|
|00000a10| 74 69 6f 6e 73 0a 61 72 | 65 20 6e 6f 74 20 74 68 |tions.ar|e not th|
|00000a20| 65 20 73 61 6d 65 20 74 | 79 70 65 20 61 20 70 6f |e same t|ype a po|
|00000a30| 69 6e 74 65 72 73 20 74 | 6f 20 6d 65 6d 62 65 72 |inters t|o member|
|00000a40| 20 66 75 6e 63 74 69 6f | 6e 73 2c 20 75 6e 6c 65 | functio|ns, unle|
|00000a50| 73 73 20 74 68 65 0a 6d | 65 6d 62 65 72 20 66 75 |ss the.m|ember fu|
|00000a60| 6e 63 74 69 6f 6e 20 69 | 73 20 73 74 61 74 69 63 |nction i|s static|
|00000a70| 2e 0a 0a 48 65 72 65 20 | 69 73 20 6d 79 20 72 65 |...Here |is my re|
|00000a80| 76 69 73 69 6f 6e 20 6f | 66 20 74 68 65 20 63 6f |vision o|f the co|
|00000a90| 64 65 20 79 6f 75 20 70 | 6f 73 74 65 64 2c 20 77 |de you p|osted, w|
|00000aa0| 69 74 68 20 61 20 66 65 | 77 20 61 64 64 69 74 69 |ith a fe|w additi|
|00000ab0| 6f 6e 61 6c 20 0a 63 6f | 6d 6d 65 6e 74 73 2e 0a |onal .co|mments..|
|00000ac0| 0a 23 69 6e 63 6c 75 64 | 65 20 3c 69 6f 73 74 72 |.#includ|e <iostr|
|00000ad0| 65 61 6d 2e 68 3e 0a 0a | 2f 2f 2f 2f 2f 2f 2f 2f |eam.h>..|////////|
|00000ae0| 2f 2f 2f 2f 2f 2f 2f 2f | 2f 2f 2f 2f 2f 2f 2f 2f |////////|////////|
|00000af0| 2f 2f 2f 2f 2f 2f 2f 2f | 2f 2f 2f 2f 2f 2f 2f 2f |////////|////////|
|00000b00| 2f 2f 2f 2f 2f 2f 2f 2f | 2f 2f 2f 2f 0a 74 79 70 |////////|////.typ|
|00000b10| 65 64 65 66 20 76 6f 69 | 64 20 28 2a 20 50 46 55 |edef voi|d (* PFU|
|00000b20| 4e 43 29 28 69 6e 74 29 | 3b 20 2f 2f 20 77 6f 72 |NC)(int)|; // wor|
|00000b30| 6b 73 20 66 6f 72 20 73 | 74 61 74 69 63 20 6d 65 |ks for s|tatic me|
|00000b40| 6d 62 65 72 20 66 75 6e | 63 74 69 6f 6e 73 0a 09 |mber fun|ctions..|
|00000b50| 09 09 09 09 09 09 2f 2f | 20 61 73 20 77 65 6c 6c |......//| as well|
|00000b60| 20 61 73 20 6e 6f 6e 2d | 6d 65 6d 62 65 72 20 66 | as non-|member f|
|00000b70| 75 6e 63 74 69 6f 6e 73 | 0a 2f 2f 2f 2f 2f 2f 2f |unctions|.///////|
|00000b80| 2f 2f 2f 2f 2f 2f 2f 2f | 2f 2f 2f 2f 2f 2f 2f 2f |////////|////////|
|00000b90| 2f 2f 2f 2f 2f 2f 2f 2f | 2f 2f 2f 2f 2f 2f 2f 2f |////////|////////|
|00000ba0| 2f 2f 2f 2f 2f 2f 2f 2f | 2f 2f 2f 2f 2f 0a 2f 2f |////////|/////.//|
|00000bb0| 2f 2f 2f 2f 2f 2f 2f 2f | 2f 2f 2f 2f 2f 2f 2f 2f |////////|////////|
|00000bc0| 2f 2f 2f 2f 2f 2f 2f 2f | 2f 2f 2f 2f 2f 2f 2f 2f |////////|////////|
|00000bd0| 2f 2f 2f 2f 2f 2f 2f 2f | 2f 2f 2f 2f 2f 2f 2f 2f |////////|////////|
|00000be0| 2f 2f 0a 63 6c 61 73 73 | 20 42 0a 7b 0a 70 75 62 |//.class| B.{.pub|
|00000bf0| 6c 69 63 3a 09 2f 2f 20 | 3c 2d 20 64 69 64 20 79 |lic:.// |<- did y|
|00000c00| 6f 75 20 6d 65 61 6e 20 | 22 70 72 69 76 61 74 65 |ou mean |"private|
|00000c10| 22 20 68 65 72 65 3f 0a | 20 20 20 20 20 20 20 20 |" here?.| |
|00000c20| 50 46 55 4e 43 20 6d 5f | 63 61 6c 6c 62 61 63 6b |PFUNC m_|callback|
|00000c30| 3b 0a 70 75 62 6c 69 63 | 3a 0a 20 20 20 20 20 20 |;.public|:. |
|00000c40| 20 20 42 28 50 46 55 4e | 43 20 63 61 6c 6c 62 61 | B(PFUN|C callba|
|00000c50| 63 6b 29 20 7b 0a 20 20 | 20 20 20 20 20 20 20 20 |ck) {. | |
|00000c60| 20 20 20 20 20 20 6d 5f | 63 61 6c 6c 62 61 63 6b | m_|callback|
|00000c70| 20 3d 20 63 61 6c 6c 62 | 61 63 6b 3b 0a 20 20 20 | = callb|ack;. |
|00000c80| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 6d 5f 63 | | m_c|
|00000c90| 61 6c 6c 62 61 63 6b 28 | 31 30 29 3b 20 2f 2f 20 |allback(|10); // |
|00000ca0| 6e 6f 20 69 6e 64 69 72 | 65 63 74 69 6f 6e 20 69 |no indir|ection i|
|00000cb0| 73 20 72 65 71 75 69 72 | 65 64 20 68 65 72 65 0a |s requir|ed here.|
|00000cc0| 20 20 20 20 20 20 20 20 | 7d 0a 20 20 20 20 20 20 | |}. |
|00000cd0| 20 20 7e 42 28 29 7b 7d | 3b 0a 7d 3b 0a 2f 2f 2f | ~B(){}|;.};.///|
|00000ce0| 2f 2f 2f 2f 2f 2f 2f 2f | 2f 2f 2f 2f 2f 2f 2f 2f |////////|////////|
|00000cf0| 2f 2f 2f 2f 2f 2f 2f 2f | 2f 2f 2f 2f 2f 2f 2f 2f |////////|////////|
|00000d00| 2f 2f 2f 2f 2f 2f 2f 2f | 2f 2f 2f 2f 2f 2f 2f 2f |////////|////////|
|00000d10| 2f 0a 63 6c 61 73 73 20 | 41 0a 7b 0a 70 75 62 6c |/.class |A.{.publ|
|00000d20| 69 63 3a 09 2f 2f 20 3c | 2d 20 64 69 64 20 79 6f |ic:.// <|- did yo|
|00000d30| 75 20 6d 65 61 6e 20 22 | 70 72 69 76 61 74 65 22 |u mean "|private"|
|00000d40| 20 68 65 72 65 3f 0a 20 | 20 20 20 20 20 20 20 73 | here?. | s|
|00000d50| 74 61 74 69 63 20 76 6f | 69 64 20 63 61 6c 6c 62 |tatic vo|id callb|
|00000d60| 61 63 6b 28 69 6e 74 20 | 65 72 72 6f 72 29 20 7b |ack(int |error) {|
|00000d70| 09 2f 2f 20 6e 6f 74 69 | 63 65 20 74 68 65 20 22 |.// noti|ce the "|
|00000d80| 73 74 61 74 69 63 22 0a | 20 20 20 20 20 20 20 20 |static".| |
|00000d90| 20 20 20 20 20 20 20 20 | 63 6f 75 74 20 3c 3c 20 | |cout << |
|00000da0| 22 49 20 61 6d 20 74 68 | 65 20 63 61 6c 6c 62 61 |"I am th|e callba|
|00000db0| 63 6b 20 66 75 6e 63 74 | 69 6f 6e 22 20 3c 3c 20 |ck funct|ion" << |
|00000dc0| 65 6e 64 6c 3b 0a 20 20 | 20 20 20 20 20 20 7d 0a |endl;. | }.|
|00000dd0| 0a 20 20 20 20 20 20 20 | 20 42 2a 20 70 42 3b 0a |. | B* pB;.|
|00000de0| 70 75 62 6c 69 63 3a 0a | 20 20 20 20 20 20 20 20 |public:.| |
|00000df0| 41 28 29 20 7b 20 0a 20 | 20 20 20 20 20 20 20 20 |A() { . | |
|00000e00| 20 20 20 20 20 20 20 70 | 42 20 3d 20 6e 65 77 20 | p|B = new |
|00000e10| 42 28 41 3a 3a 63 61 6c | 6c 62 61 63 6b 29 3b 0a |B(A::cal|lback);.|
|00000e20| 20 20 20 20 20 20 20 20 | 7d 3b 0a 20 20 20 20 20 | |};. |
|00000e30| 20 20 20 7e 41 28 29 20 | 7b 0a 20 20 20 20 20 20 | ~A() |{. |
|00000e40| 20 20 20 20 20 20 20 20 | 20 20 64 65 6c 65 74 65 | | delete|
|00000e50| 20 70 42 3b 0a 20 20 20 | 20 20 20 20 20 7d 3b 0a | pB;. | };.|
|00000e60| 7d 3b 0a 0a 0a 76 6f 69 | 64 20 6d 61 69 6e 28 29 |};...voi|d main()|
|00000e70| 0a 7b 0a 09 41 20 61 3b | 0a 09 42 20 62 28 41 3a |.{..A a;|..B b(A:|
|00000e80| 3a 63 61 6c 6c 62 61 63 | 6b 29 3b 0a 7d 0a 0a 54 |:callbac|k);.}..T|
|00000e90| 68 69 73 20 63 6f 64 65 | 20 77 69 6c 6c 20 70 72 |his code| will pr|
|00000ea0| 69 6e 74 20 6f 75 74 3a | 0a 0a 49 20 61 6d 20 74 |int out:|..I am t|
|00000eb0| 68 65 20 63 61 6c 6c 62 | 61 63 6b 20 66 75 6e 63 |he callb|ack func|
|00000ec0| 74 69 6f 6e 0a 49 20 61 | 6d 20 74 68 65 20 63 61 |tion.I a|m the ca|
|00000ed0| 6c 6c 62 61 63 6b 20 66 | 75 6e 63 74 69 6f 6e 0a |llback f|unction.|
|00000ee0| 0a 49 20 68 6f 70 65 20 | 74 68 69 73 20 68 65 6c |.I hope |this hel|
|00000ef0| 70 73 2e 20 50 6c 65 61 | 73 65 20 61 73 6b 20 66 |ps. Plea|se ask f|
|00000f00| 6f 72 20 63 6c 61 72 69 | 66 69 63 61 74 69 6f 6e |or clari|fication|
|00000f10| 20 69 66 20 69 74 20 64 | 6f 65 73 20 6e 6f 74 2e | if it d|oes not.|
|00000f20| 0a 0a 4b 65 76 69 6e 20 | 49 6e 67 61 6c 6c 73 2c |..Kevin |Ingalls,|
|00000f30| 20 28 32 30 36 29 37 37 | 33 2d 39 34 30 34 2c 20 | (206)77|3-9404, |
|00000f40| 69 6e 67 6b 6c 39 30 30 | 40 63 63 6d 61 69 6c 2e |ingkl900|@ccmail.|
|00000f50| 63 61 2e 62 6f 65 69 6e | 67 2e 63 6f 6d 0a 0a 0a |ca.boein|g.com...|
+--------+-------------------------+-------------------------+--------+--------+